function [theta, vec] = convertRotationMatrix2AngleAxis(R)

    theta = acos( 0.5*(R(1,1) + R(2,2) + R(3,3) - 1) );
    
    vec = 1 / ( 2*sin(theta) ) * [ R(3,2) - R(2,3) ;
                                   R(1,3) - R(3,1) ;
                                   R(2,1) - R(1,2) ];
